MnO2 = cc.Node.extend({
	ctor:function(p){
		this._super();
		p.addChild(this, 10, TAG_MNO2_NODE);
		this.init();
	},
	init : function(){
		this.setCascadeOpacityEnabled(true);
		var lid= new Button(this, 8, TAG_MNO2LID, "#mnlid.png",this.callback);
		lid.setPosition(0,75);

		this.mno2bottle= new Button(this, 10, TAG_MNO2BOTTLE, "#mn.png",this.callback);		
		this.mno2bottle1 = new cc.Sprite("#mn1.png");
		this.addChild(this.mno2bottle1);
		
		var mno2= new Button(this, 8, TAG_MNO2, "#mnfenmo.png",this.callback);	
		 mno2.setPosition(106,-150);
		 mno2.setScale(0.2,0.5);
		 mno2.setOpacity(0);
		
		
		//"NH₃ + CO₂ + H₂O = NH₄HCO₃\n" 
		var label = new cc.LabelTTF("MnO₂","微软雅黑",22);
		label.setPosition(56,77);
		label.setColor(cc.color(0,0,0));
		this.mno2bottle.addChild(label,11);
		
		var spoon= new Button(this,9, TAG_MNSPOON, "#mnspoon.png",this.callback);
		spoon.setScale(0.6);
		spoon.setRotation(50);
		spoon.setPosition(200,-60);
		
	},

	callback:function(p){
		var action = gg.flow.flow.action;
		var func = cc.callFunc(this.actionDone, this);	
		switch(p.getTag()){	
		case TAG_MNO2LID:
			if(action == ACTION_DO1){
			var seq = cc.sequence(cc.moveTo(0.5,cc.p(0,120)),cc.moveTo(0.5,cc.p(-70,100)),cc.spawn(cc.moveTo(1,cc.p(-120,-70)),cc.rotateTo(1,-180)),
					cc.callFunc(function(){
						p.setSpriteFrame("mnlid1.png");
						p.setRotation(0);
						this.flowNext();
					},this));
			p.runAction(seq);
			}
			
			if(action == ACTION_DO2){
				var seq = cc.sequence(cc.spawn(cc.moveTo(1,cc.p(0,120)),cc.rotateTo(1,-180)),cc.moveTo(0.5,cc.p(0,75)),
						cc.callFunc(function(){
							p.setSpriteFrame("mnlid.png");
							p.setRotation(0);
							this.flowNext();
						},this));
				p.runAction(seq);
			}
			break;
		case TAG_MNSPOON:
			if(action == ACTION_DO1){
				this.mno2bottle.runAction(cc.sequence(cc.rotateTo(1,30),cc.delayTime(3),cc.rotateTo(1,0)));
				this.mno2bottle1.runAction(cc.sequence(cc.rotateTo(1,30),cc.delayTime(3),cc.rotateTo(1,0)));
				var sp = cc.spawn(cc.moveTo(1,cc.p(130,170)),cc.rotateTo(1,10));
				var move = cc.moveTo(1,cc.p(50,80));
				var move1 = cc.moveTo(1,cc.p(130,170));
				var move2 = cc.moveTo(1,cc.p(170,-70));
				var moveback=cc.moveTo(1.5,cc.p(200,-60));
				var seq = cc.sequence(sp,move,cc.callFunc(function(){
					p.setSpriteFrame("mnspoon1.png");
				},this),move1,move2,cc.callFunc(function(){
					p.setSpriteFrame("mnspoon.png");
					this.getChildByTag(TAG_MNO2).runAction(cc.sequence(cc.fadeTo(0.1, 255),cc.moveTo(1,cc.p(106,-335))));
				},this),cc.delayTime(1),cc.spawn(moveback,cc.rotateTo(1.5,50)),cc.callFunc(function(){
					
					this.flowNext();
				},this));
				p.runAction(seq);
				break;
			}
			if(action == ACTION_DO2){
			this.mno2bottle.runAction(cc.rotateTo(1,30));
			this.mno2bottle1.runAction(cc.rotateTo(1,30));
			var sp = cc.spawn(cc.moveTo(1,cc.p(130,170)),cc.rotateTo(1,10));
			var move = cc.moveTo(1,cc.p(50,80));
			var move1 = cc.moveTo(1,cc.p(130,170));
			var move2 = cc.moveTo(1,cc.p(180,-170+50));
			var seq = cc.sequence(sp,move,cc.callFunc(function(){
				p.setSpriteFrame("mnspoon1.png");
			},this),move1,move2,cc.callFunc(function(){
				p.setSpriteFrame("mnspoon.png");
				ll.run.iron.getChildByTag(TAG_FLASK_NODE).fenmodisplay();
			},this),cc.delayTime(2),cc.callFunc(function(){
				this.removeFromParent(true);
				this.flowNext();
			},this));
			p.runAction(seq);
			break;
		}
		}
	},
	flowNext:function(){
		gg.flow.next();
	},
});